import Vue from 'vue'
import Router from 'vue-router'
// import HelloWorld from '@/components/HelloWorld'
import Login from '@/Login'
import Index from '@/Index'
import CompanyAdd from '@/pages/company/CompanyAdd'
import CompanyShow from '@/pages/company/CompanyShow'
import CompanyEdit from '@/pages/company/CompanyEdit'
import MealAdd from '@/pages/meal/MealAdd'
import MealShow from '@/pages/meal/MealShow'
import MealEdit from '@/pages/meal/MealEdit'

Vue.use(Router)

export default new Router({
  routes: [
   {
      path: '/',
       redirect:'/login'
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/index',
      name: 'Index',
      component: Index,
      children:[
        { path: '/company/add', component: CompanyAdd},
        { path: '/company/show', component: CompanyShow},
        { path: '/meal/show', component: MealShow},
        { path: '/meal/add', component: MealAdd},
        { path: '/meal/edit/:id', component: MealEdit},
        { path: '/company/edit/:id', component: CompanyEdit},
      ]
    }
  ]
})
